package iscript.gameFramework.NetService.util
{
	/**
	 * 
	 * 如果用来显示十进制，每位最高显示10e+9
	 * 
	 * */
	
	public class BigInt
	{		
		public function clone():BigInt
		{
			var newBigInt:BigInt = new BigInt;
			newBigInt.high = this.high;
			newBigInt.light = this.light;
			return newBigInt;
		}
		
		static public function get Empty():BigInt { return new BigInt();}
		 
		public function isZero():Boolean {
			return this.toNumber() == 0;
			}
		 
		public function isEqual($another:BigInt):Boolean
		{
			return this.toNumber() == $another.toNumber();
		}
         
		public function isBiggerOrEqual($another:BigInt):Boolean
		{
			return this.toNumber() >= $another.toNumber();
		}
		
		public function toStr():String
		{
			var result:Number = high * Math.pow(2,32) + light;			
			return result.toString();
		}
		
		public function toNumber():Number
		{
			var result:Number = high * Math.pow(2,32) + light;
			return result;
		}
		
		private function toFullStr($data:uint, $length:int):String
		{
			var str:String = $data.toString();
			while(str.length<$length)
			{
				str = "0"+str;
			}
			return str;
		}
		
		public var high:uint;
		public var light:uint;
		
	}
}